home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Workspace / PackageInspector0.95 / Source / PackageInspector.h < prev    next >
Text File  |  1995-07-29  |  3KB  |  116 lines

  1. /*+++*
  2.  *  title:    PackageInspector.h
  3.  *  abstract:    interface definitions for WM PackageInspector 
  4.  *  author:    T.R.Hageman, Groningen, The Netherlands
  5.  *  created:    November 1994
  6.  *  modified:    (see RCS Log at end)
  7.  *  copyleft:
  8.  *
  9.  *        Copyright (C) 1994,1995  Tom R. Hageman.
  10.  *
  11.  *    This is free software; you can redistribute it and/or modify
  12.  *    it under the terms of the GNU General Public License as published by
  13.  *    the Free Software Foundation; either version 2 of the License, or
  14.  *    (at your option) any later version.
  15.  *
  16.  *    This software is distributed in the hope that it will be useful,
  17.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  *    GNU General Public License for more details.
  20.  *
  21.  *    You should have received a copy of the GNU General Public License
  22.  *    along with this software; if not, write to the Free Software
  23.  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  *
  25.  *  description:
  26.  *
  27.  *---*/
  28.  
  29. #import <appkit/appkit.h>
  30. #import <apps/Workspace.h>
  31.  
  32. #include <sys/stat.h>
  33.  
  34. #import "Subprocess.h"
  35.  
  36. #define NUMSTATS    4
  37. #define TYPESTOSTAT    "bom", "info", "sizes", "tiff"
  38.  
  39. @interface PackageInspector:WMInspector
  40. {
  41.     // Outlets
  42.     id    packageArchesField;
  43.     id    packageDescriptionText;
  44.     id    packageIconButton;
  45.     id    packageLocationField;
  46.     id    packageSizesField;
  47.     id    packageStatusField;
  48.     id    packageTitleField;
  49.     id    packageVersionField;
  50.  
  51.     id  inspectorVersionField;
  52.     id    infoPanel;
  53.     id    infoVersionField;
  54.  
  55.     // other variables.
  56.     NXBundle *bundle;        // class bundle.
  57.     NXBundle *package;        // package bundle.
  58.     struct stat stats[NUMSTATS];    // for lazy inspection.
  59.     enum { listContents, listDescription } revertButtonState;
  60.  
  61.     Subprocess *archProcess;    // To determine architectures.
  62. }
  63.  
  64. // Actions.
  65. -showInfo:sender;
  66.  
  67. // The workhorses
  68. -(BOOL)shouldLoad;
  69. -load;
  70. -toggleDescription;
  71.  
  72. // Load helper methods
  73. -loadKeyValuesFrom:(const char *)type inTable:(HashTable *)table;
  74. -loadContentsOf:(const char *)type inTable:(HashTable *)table;
  75. -loadImage;
  76.  
  77. // Support methods
  78. -(const char *)getPath:(char *)path forType:(const char *)type;
  79. -setRevertButtonTitle;
  80. -(const char *)formatSize:(const char *)size inBuf:(char *)buf;
  81.  
  82. // Determine architectures, in separate subprocess.
  83. -(void)getArchs;
  84. // Subprocess [TRH-enhanced] delegate methods:
  85. // Subprocess delegate methods:
  86. -subprocess:(Subprocess *)sender output:(char *)buffer;
  87. -subprocessDone:(Subprocess *)sender;
  88.  
  89. @end
  90.  
  91. /*======================================================================
  92.  * PackageInspector.h,v
  93.  * Revision 1.6  1995/07/30 16:59:51  tom
  94.  * import Subprocess.h; (archProcess): new ivar;
  95.  * (-getArchs,-subprocess:output:,-subprocessDone:): new methods;
  96.  * added for asynchronous arch-determination.
  97.  *
  98.  * Revision 1.5  1995/07/29 02:59:55  tom
  99.  * (NUMSTATS,TYPESTOSTAT): new defines, (stats[NUMSTATS]): new ivar, replaces
  100.  * bomstat, infostat, t ogeneralize lazy-load code.
  101.  *
  102.  * Revision 1.4  1995/04/02  02:39:05  tom
  103.  * (package): NXBundle instead of (const char *). so that localized info files
  104.  *  are found. (this loses out if *.pkg is a symbolic link, though.)
  105.  *
  106.  * Revision 1.3  1994/12/07  00:00:36  tom
  107.  * add GNU copleft comment.
  108.  *
  109.  * Revision 1.2  1994/11/25  20:18:56  tom
  110.  * (package ivar): use (char*) instead of (NXBundle*) to workaround symlink problems
  111.  *
  112.  * Revision 1.1  1994/11/24  22:39:56  tom
  113.  * Initial revision
  114.  *
  115.  *======================================================================*/
  116.